package com.foruo.learn.designmode.decorator;

/**
 * 商品+限量版
 * 装饰类
 * @author GaoYuan
 */
public class LimitGoods extends Goods{

    private Goods goods;

    public LimitGoods(Goods goods){
        this.goods = goods;
    }

    @Override
    public String getName() {
        return "限量版" + goods.getName();
    }

    /**
     * 限量版 + 200元
     * @author GaoYuan
     */
    @Override
    public double price() {
        return 200 + goods.price();
    }
}
